package router

import (
	"github.com/gin-gonic/gin"
	"lab.com/middleware"
)

// InitRouter init all the routes and start the engine
func InitRouter() *gin.Engine {

	e := gin.New()

	e.Use(gin.Recovery(), middleware.Cross(), middleware.Options())

	//用户
	initUserRouter(e)

	//科研成就
	initAchievementRouter(e)

	//新闻公告
	initNewsRouter(e)

	//合作交流
	initCooperationRouter(e)

	//产学研
	initIurRouter(e)

	//上传
	initUploadRouter(e)

	//轮播图
	initBannerRouter(e)

	//论文管理
	initPaperRouter(e)

	//论坛管理
	initForumRouter(e)

	//文件管理
	initFileRouter(e)

	return e
}
